/* Yet Another Experimental Software Renderer
 *
 * Copyright (c) 2010 Pawel "Hery" Dziepak
 */

#ifndef DEBUG_H_
#define DEBUG_H_

#define _quote(x) #x
#define quote(x) _quote(x)

#define Panic() __debugbreak()

#define Error(x)	yaesr::error(x, __LINE__, __FILE__)
#define Verify(x)	yaesr::assert(x, quote(x), __LINE__, __FILE__)

#ifndef NDEBUG
#define Assert(x)	yaesr::assert(x, quote(x), __LINE__, __FILE__)
#define Warning(x)	yaesr::warning(x, __LINE__, __FILE__)
#else
#define Assert(x)	(x)
#define Warning(x)	(x)
#endif

namespace yaesr {
	void assert(bool check, const char *expr, long line, const char *file);
	void error(const char *expr, long line, const char *file);
	void warning(const char *expr, long line, const char *file);
}

#endif